package string;

/**
 * 使用StringBuilder测试对字符串修改的性能
 */
public class StringBuilderDemo2 {
    public static void main(String[] args) {
        /*
            创建StringBuilder实例，循环1000000次，每次在字符串末尾添加一个字符串"a"
         */
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 1000000; i++) {
            sb.append("a");
        }
        System.out.println("执行完毕");



    }
}
